﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using MiniSched.Orm;
using MiniSched.Web.Areas.Api.Models;

namespace MiniSched.Web.Areas.Api.Controllers {

    public class UserProfileApiController : EntityApiController<UserProfile, UserProfileRequestModel> {

        internal override UserProfile Create(UserProfile model) {
            if (null == model) throw new ArgumentNullException("model");

            return new UserProfile {
                EmailAddress = model.EmailAddress,
                UserName = model.UserName
            };
        }

        internal override void Update(UserProfile entity, UserProfile model) {
            if (null == model) throw new ArgumentNullException("model");
            if (null == entity) throw new ArgumentNullException("entity");
            entity.EmailAddress = model.EmailAddress;
        }
    }
}
